home *** CD-ROM | disk | FTP | other *** search
- {$c-}
- program WSfixer(input,output);
-
-
- {
- version 1.1
-
- This is an example of how to redirect input and output using
- Turbo Pascal. Those of you who may have purchased 'Turbo Tutor'
- and found that the program titled 'FILTER.PAS' does'nt, will be
- happy to know that this program DOES!!
-
- In this example, the program will redirect or filter any file,
- converting a 'Wordstar' document file into a standard text file.
-
- This new version is much faster; it processes up to 32k with only
- one disk access. Also, the input-output routines have been
- placed in their own 'included' file.
-
-
- If there are problems with this program call me:
- Ken Kaplan
- 213-596-8635 (ans. machine)
-
- Try typing '>A:NWSFX <WSFILE.DOC >TXTFILE.DOC'...and have fun!
-
- copyright (c) 1985 Renaissance Software
- }
-
- const
- buffsize=$7fff;
-
- type
- aptr =^data;
- data =record
- dta:array[1..buffsize] of byte;
- end;
-
-
- var
-
- error,i,
- bytes :integer;
- done :boolean;
- dtaptr :aptr;
-
- {$i stand_io.inc}
-
- begin
- repeat
- done:=false;
- i:=1;
- new(dtaptr);
- bytes:=buffsize;
- with dtaptr^ do begin
- stdread(bytes,error,seg(dta),ofs(dta));
- if error<>$01 then begin
- repeat
- if (dta[i]>$7f) then
- dta[i]:=(dta[i] and $7f);
- i:=i+1;
- until ((dta[i]=26) or (i=buffsize+1));
- stdwrite(bytes,error,seg(dta),ofs(dta));
- end
- else
- done:=true;
- end;
- until done;
- dispose(dtaptr);
- end.
-
-